﻿<%@ WebHandler Language="C#" Class="PP_Handler" %>

using System;
using System.Web;
using System.Collections.Generic;
using System.Data;

public class PP_Handler : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        if (context.Request["mode"] != null)
        {
            string mode = context.Request["mode"].ToString();
            switch (mode)
            {
                case "Qry":
                    QueryData(context);
                    break;
            }
        }
    }

    public void QueryData(HttpContext context)
    {
        string page = context.Request["page"];
        string rows = context.Request["rows"];
        string promotionsId = context.Request["p"];

        BusinessRule.Promotion.PromotionsManager manager = new BusinessRule.Promotion.PromotionsManager();
        context.Response.Write(manager.GetTableJsonString(rows, page, promotionsId));
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}